class HomepageIndexer(object):
    def __init__(self, app=None):
        print "created hompage indexer..."
        self.app = app
        self.uri = '/index/homepage'

    def __call__(self, environ, start_response):
        print "calling hompeage indexer"
        path = environ.get('PATH_INFO', '')
        print "%s in HompageIndexer" % path
        if path != self.uri:
            if self.app:
                return self.app(environ, start_response)
            else:
                start_response('404 Not Found')
                return []
        for k, x in environ.items():
            print "[%s] %s" % (k, x)
        start_response('200 OK', [('Content-type', 'text/xml')])
        xml_value = '<response><result>index homepage</result></response>'
        return [xml_value]
    
